import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] a = in.next().toCharArray();
        char[] b = in.next().toCharArray();
        int n = a.length,m = b.length;
        int ret = n;
        for (int i = 0; i <= n - m ; i++) {
            int tmp = 0;
            for (int j = 0; j < n; j++) {
                if(a[j] != b[i + j]){
                    tmp ++;
                }
            }
            ret = Math.min(ret,tmp);
        }
        System.out.println(m - ret);
    }
}